<template>
  <div id="customer-mailing-address" class="row">
    <template v-for="info of addresses">
      <div class="card" :key="`mailing_addr_` + info.id">
        <div class="card-header">
          {{ info.alias }}
        </div>
        <div class="card-body">
          <dl class="row">
            <dt class="col-3 text-end">联系人</dt>
            <dd class="col-9">{{ info.linkman }}</dd>
            <dt class="col-3 text-end">手机</dt>
            <dd class="col-9">{{ info.mobile }}</dd>
            <dt class="col-3 text-end">Email</dt>
            <dd class="col-9">{{ info.email }}</dd>
            <dt class="col-3 text-end">电话</dt>
            <dd class="col-9">{{ info.phone }}</dd>
            <dt class="col-3 text-end">地址</dt>
            <dd class="col-9">{{ info.address }}</dd>
          </dl>
        </div>
      </div>
    </template>
  </div>
</template>

<script>
export default {
  props: {
    customerId: {
      type: Number,
    },
    addresses: {
      type: Array,
    },
  },
  methods: {
    showErrMsg: function (msg, msgType) {
      this.$store.dispatch("showAlertMsg", {
        errMsg: msg,
        errMsgType: msgType,
      });
    },
    showLoading: function (msg) {
      this.$store.dispatch("showLoading", { loadingText: msg });
    },
    hideLoading: function () {
      this.$store.dispatch("hideLoading");
    },
  },
};
</script>